/*     */ package com.zimbra.cs.ldap;
/*     */ 
/*     */ import com.zimbra.common.service.ServiceException;
/*     */ import com.zimbra.common.service.ServiceException.Argument;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class LdapException
/*     */   extends ServiceException
/*     */ {
/*     */   public static final String TODO = "ldap.TODO";
/*     */   public static final String INVALID_CONFIG = "ldap.INVALID_CONFIG";
/*     */   public static final String LDAP_ERROR = "ldap.LDAP_ERROR";
/*     */   public static final String CONTEXT_NOT_EMPTY = "ldap.CONTEXT_NOT_EMPTY";
/*     */   public static final String ENTRY_ALREADY_EXIST = "ldap.ENTRY_ALREADY_EXIST";
/*     */   public static final String ENTRY_NOT_FOUND = "ldap.ENTRY_NOT_FOUND";
/*     */   public static final String INVALID_ATTR_NAME = "ldap.INVALID_ATTR_NAME";
/*     */   public static final String INVALID_ATTR_VALUE = "ldap.INVALID_ATTR_VALUE";
/*     */   public static final String INVALID_NAME = "ldap.INVALID_NAME";
/*     */   public static final String INVALID_SEARCH_FILTER = "ldap.INVALID_SEARCH_FILTER";
/*     */   public static final String INVALID_REQUEST = "ldap.INVALID_REQUEST";
/*     */   public static final String MULTIPLE_ENTRIES_MATCHED = "ldap.MULTIPLE_ENTRIES_MATCHED";
/*     */   public static final String OBJECT_CLASS_VIOLATION = "ldap.OBJECT_CLASS_VIOLATION";
/*     */   public static final String SIZE_LIMIT_EXCEEDED = "ldap.SIZE_LIMIT_EXCEEDED";
/*     */   private Throwable detail;
/*     */   
/*     */   private static String format(String msg1, String msg2, Throwable cause)
/*     */   {
/*  47 */     String msg = msg1;
/*  48 */     if (msg2 != null) {
/*  49 */       msg = msg + " - " + msg2;
/*     */     }
/*     */     
/*  52 */     if (cause != null) {
/*  53 */       return msg + ": " + cause.getMessage();
/*     */     }
/*  55 */     return msg;
/*     */   }
/*     */   
/*     */   public void setDetail(Throwable detail)
/*     */   {
/*  60 */     this.detail = detail;
/*     */   }
/*     */   
/*     */   public Throwable getDetail() {
/*  64 */     return this.detail;
/*     */   }
/*     */   
/*     */   protected LdapException(String message, String code, Throwable cause) {
/*  68 */     super(message, code, true, cause, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static LdapException TODO() {
/*  72 */     return new LdapException("TODO", "ldap.TODO", null);
/*     */   }
/*     */   
/*     */   public static LdapException INVALID_CONFIG(Throwable cause) {
/*  76 */     return new LdapException("config error", "ldap.INVALID_CONFIG", cause);
/*     */   }
/*     */   
/*     */   public static LdapException INVALID_CONFIG(String message, Throwable cause) {
/*  80 */     return new LdapException(format("config error: ", message, cause), "ldap.INVALID_CONFIG", cause);
/*     */   }
/*     */   
/*     */   public static LdapException LDAP_ERROR(Throwable cause)
/*     */   {
/*  85 */     return new LdapException("LDAP error", "ldap.LDAP_ERROR", cause);
/*     */   }
/*     */   
/*     */   public static LdapException LDAP_ERROR(String message, Throwable cause)
/*     */   {
/*  90 */     return new LdapException(format("LDAP error: ", message, cause), "ldap.LDAP_ERROR", cause);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */   public static LdapException CONTEXT_NOT_EMPTY(String message, Throwable cause)
/*     */   {
/*  97 */     return new LdapContextNotEmptyException(message, cause, null);
/*     */   }
/*     */   
/*     */   public static LdapException INVALID_ATTR_NAME(String message, Throwable cause) {
/* 101 */     return new LdapInvalidAttrNameException(message, cause, null);
/*     */   }
/*     */   
/*     */   public static LdapException INVALID_ATTR_VALUE(String message, Throwable cause) {
/* 105 */     return new LdapInvalidAttrValueException(message, cause, null);
/*     */   }
/*     */   
/*     */   public static LdapException INVALID_NAME(String message, Throwable cause) {
/* 109 */     return new LdapInvalidNameException(message, cause, null);
/*     */   }
/*     */   
/*     */   public static LdapException INVALID_SEARCH_FILTER(String message, Throwable cause) {
/* 113 */     return new LdapInvalidSearchFilterException(message, cause, null);
/*     */   }
/*     */   
/*     */   public static LdapException INVALID_REQUEST(String message, Throwable cause) {
/* 117 */     return new LdapInvalidRequestException(message, cause, null);
/*     */   }
/*     */   
/*     */   public static LdapException ENTRY_ALREADY_EXIST(String message, Throwable cause) {
/* 121 */     return new LdapEntryAlreadyExistException(message, cause, null);
/*     */   }
/*     */   
/*     */   public static LdapException ENTRY_NOT_FOUND(String message, Throwable cause) {
/* 125 */     return new LdapEntryNotFoundException(message, cause, null);
/*     */   }
/*     */   
/*     */   public static LdapException MULTIPLE_ENTRIES_MATCHED(String base, String query, String dups)
/*     */   {
/* 130 */     return new LdapMultipleEntriesMatchedException(base, query, dups, null);
/*     */   }
/*     */   
/*     */   public static LdapException OBJECT_CLASS_VIOLATION(String message, Throwable cause) {
/* 134 */     return new LdapObjectClassViolationException(message, cause, null);
/*     */   }
/*     */   
/*     */   public static LdapException SIZE_LIMIT_EXCEEDED(String message, Throwable cause) {
/* 138 */     return new LdapSizeLimitExceededException(message, cause, null);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */   public static class LdapContextNotEmptyException
/*     */     extends LdapException
/*     */   {
/*     */     private LdapContextNotEmptyException(String message, Throwable cause)
/*     */     {
/* 148 */       super("ldap.CONTEXT_NOT_EMPTY", cause);
/*     */     }
/*     */   }
/*     */   
/*     */   public static class LdapEntryAlreadyExistException extends LdapException {
/*     */     private LdapEntryAlreadyExistException(String message, Throwable cause) {
/* 154 */       super("ldap.ENTRY_ALREADY_EXIST", cause);
/*     */     }
/*     */   }
/*     */   
/*     */   public static class LdapEntryNotFoundException extends LdapException {
/*     */     private LdapEntryNotFoundException(String message, Throwable cause) {
/* 160 */       super("ldap.ENTRY_NOT_FOUND", cause);
/*     */     }
/*     */   }
/*     */   
/*     */   public static class LdapInvalidAttrNameException extends LdapException {
/*     */     private LdapInvalidAttrNameException(String message, Throwable cause) {
/* 166 */       super("ldap.INVALID_ATTR_NAME", cause);
/*     */     }
/*     */   }
/*     */   
/*     */   public static class LdapInvalidAttrValueException extends LdapException {
/*     */     private LdapInvalidAttrValueException(String message, Throwable cause) {
/* 172 */       super("ldap.INVALID_ATTR_VALUE", cause);
/*     */     }
/*     */   }
/*     */   
/*     */   public static class LdapInvalidNameException extends LdapException {
/*     */     private LdapInvalidNameException(String message, Throwable cause) {
/* 178 */       super("ldap.INVALID_NAME", cause);
/*     */     }
/*     */   }
/*     */   
/*     */   public static class LdapInvalidSearchFilterException extends LdapException {
/*     */     private LdapInvalidSearchFilterException(String message, Throwable cause) {
/* 184 */       super("ldap.INVALID_SEARCH_FILTER", cause);
/*     */     }
/*     */   }
/*     */   
/*     */   public static class LdapInvalidRequestException
/*     */     extends LdapException {
/* 190 */     private LdapInvalidRequestException(String message, Throwable cause) { super("ldap.INVALID_REQUEST", cause); }
/*     */   }
/*     */   
/*     */   public static class LdapMultipleEntriesMatchedException extends LdapException {
/*     */     private String base;
/*     */     private String query;
/*     */     private String dups;
/*     */     
/*     */     private LdapMultipleEntriesMatchedException(String base, String query, String dups) {
/* 199 */       super("ldap.MULTIPLE_ENTRIES_MATCHED", null);
/*     */       
/* 201 */       this.base = base;
/* 202 */       this.query = query;
/* 203 */       this.dups = dups;
/*     */     }
/*     */     
/*     */     public String getQueryBase() {
/* 207 */       return this.base;
/*     */     }
/*     */     
/*     */     public String getQuery() {
/* 211 */       return this.query;
/*     */     }
/*     */     
/*     */     public String getDuplicatedEntries() {
/* 215 */       return this.dups;
/*     */     }
/*     */   }
/*     */   
/*     */   public static class LdapObjectClassViolationException extends LdapException {
/*     */     private LdapObjectClassViolationException(String message, Throwable cause) {
/* 221 */       super("ldap.OBJECT_CLASS_VIOLATION", cause);
/*     */     }
/*     */   }
/*     */   
/*     */   public static class LdapSizeLimitExceededException extends LdapException {
/*     */     private LdapSizeLimitExceededException(String message, Throwable cause) {
/* 227 */       super("ldap.SIZE_LIMIT_EXCEEDED", cause);
/*     */     }
/*     */   }
/*     */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/ldap/LdapException.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */